package y_2025.m05.d23;

import java.util.*;

public class SubsetSum {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int c = scanner.nextInt();
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) {
            nums[i] = scanner.nextInt();
        }
        scanner.close();

        List<Integer> result = findSubset(nums, c);
        if (result.isEmpty()) {
            System.out.println("No Solution!");
        } else {
            for (int num : result) {
                System.out.print(num + " ");
            }
        }
    }

    private static List<Integer> findSubset(int[] nums, int target) {
        boolean[] dp = new boolean[target + 1];
        List<Integer>[] subsets = new ArrayList[target + 1];
        dp[0] = true;
        subsets[0] = new ArrayList<>();

        for (int num : nums) {
            for (int j = target; j >= num; j--) {
                if (dp[j - num]) {
                    dp[j] = true;
                    if (subsets[j] == null) {
                        subsets[j] = new ArrayList<>(subsets[j - num]);
                        subsets[j].add(num);
                    }
                    if (j == target) {
                        return subsets[j];
                    }
                }
            }
        }
        return new ArrayList<>();
    }
}